package com.fqr;

public class ArrayToString {

	public static String toString(Object[] array) {
		return toString(array, ' ');
	}
	
	public static String toString(Object[] array, char sep) {
		StringBuffer buf = new StringBuffer();
		if(array == null || array.length == 0)
			return "";
		
		for(Object obj : array) {
			if(obj == null)
				buf.append("null");
			else
				buf.append(obj.toString());
			
			buf.append(sep);
		}
		
		buf.deleteCharAt(buf.length() - 1);
		
		return buf.toString();
	}
}
